chore: cherry-pick API update for calculating grade summary#69
Merged
nsprenkle merged 1 commit intorelease-ulmofrom Jan 6, 2026
Merged
chore: cherry-pick API update for calculating grade summary#69nsprenkle merged 1 commit intorelease-ulmofrom
nsprenkle merged 1 commit intorelease-ulmofrom
Conversation
…ade (openedx#37399) This commit migrates the data calculation logic for the GradeSummary table, which was previously in the frontend-app-learning. This commit also introduces a new visibility option for assignment scores: “Never show individual assessment results, but show overall assessment results after the due date.” With this option, learners cannot see question-level correctness or scores at any time. However, once the due date has passed, they can view their overall score in the total grades section on the Progress page. These two changes are coupled with each other because it compromises the integrity of this data to do the score hiding logic on the front end. The corresponding frontend PR is: openedx/frontend-app-learning#1797
There was a problem hiding this comment.
Pull request overview
This PR cherry-picks changes from the main edx-platform repository to add a new grade visibility option called "never_but_include_grade". This option allows course teams to hide individual problem correctness from learners while still including those grades in the final grade calculation after the due date.
Key Changes:
- Adds a new
NEVER_BUT_INCLUDE_GRADEconstant to theShowCorrectnessclass for managing grade visibility - Implements API endpoints to aggregate and summarize assignment-type grades with proper visibility filtering
- Updates the progress page template to correctly distinguish between grade display and grade calculation logic
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
xmodule/graders.py |
Adds the NEVER_BUT_INCLUDE_GRADE constant and updates correctness_available() to treat it like NEVER for display purposes |
xmodule/tests/test_graders.py |
Adds test coverage for the new NEVER_BUT_INCLUDE_GRADE option |
lms/djangoapps/grades/subsection_grade.py |
Updates show_grades() method to handle grade inclusion logic for NEVER_BUT_INCLUDE_GRADE based on due dates |
lms/templates/courseware/progress.html |
Updates template to use ShowCorrectness.correctness_available() instead of show_grades() for display logic |
lms/djangoapps/courseware/tests/test_views.py |
Adds comprehensive test coverage for NEVER_BUT_INCLUDE_GRADE in progress page scenarios |
lms/djangoapps/course_home_api/progress/views.py |
Adds new API response fields for assignment type grade summaries and filters out NEVER_BUT_INCLUDE_GRADE subsections from section scores |
lms/djangoapps/course_home_api/progress/tests/test_views.py |
Updates test expectations to account for the new NEVER_BUT_INCLUDE_GRADE option in grade calculations |
lms/djangoapps/course_home_api/progress/api.py |
Implements new grade aggregation logic with _AssignmentBucket and _AssignmentTypeGradeAggregator classes |
lms/djangoapps/course_home_api/progress/tests/test_api.py |
Adds comprehensive test scenarios for the new aggregation functionality |
lms/djangoapps/course_home_api/progress/serializers.py |
Adds serializers for assignment type grade summaries and updates subsection serializer to include due dates |
cms/templates/js/show-correctness-editor.underscore |
Adds UI option for course teams to select the "never_but_include_grade" visibility setting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jansenk
approved these changes
Jan 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change is needed for some work we're doing on Learning MFE (https://github.com/edx/frontend-plugins/pull/111). Cherry picking it for compatibility.
Supporting information
Jira: https://2u-internal.atlassian.net/browse/AU-2763
Deadline
ASAP